/*
 Navicat Premium Data Transfer

 Source Server         : Local
 Source Server Type    : MySQL
 Source Server Version : 50144
 Source Host           : localhost
 Source Database       : inscricoes

 Target Server Type    : MySQL
 Target Server Version : 50144
 File Encoding         : utf-8

 Date: 10/24/2012 01:32:16 AM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `tbEventos`
-- ----------------------------
DROP TABLE IF EXISTS `tbEventos`;
CREATE TABLE `tbEventos` (
  `codEvento` int(11) NOT NULL AUTO_INCREMENT,
  `codUsuario` int(11) NOT NULL,
  `evTitulo` varchar(255) DEFAULT NULL,
  `evDescricao` text,
  `evCapa` varchar(255) DEFAULT NULL,
  `evDataInicio` date DEFAULT NULL,
  `evDataFim` date DEFAULT NULL,
  `evValor` double DEFAULT NULL,
  `evDesconto` double DEFAULT NULL,
  `evDataDesconto` date DEFAULT NULL,
  `evDataCad` date DEFAULT NULL,
  `evAtivo` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`codEvento`,`codUsuario`),
  KEY `fk_tbEventos_tbUsuarios1` (`codUsuario`),
  CONSTRAINT `fk_tbEventos_tbUsuarios1` FOREIGN KEY (`codUsuario`) REFERENCES `tbusuarios` (`codUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

-- ----------------------------
--  Records of `tbEventos`
-- ----------------------------
BEGIN;
INSERT INTO `tbEventos` VALUES ('1', '1', 'Congresso Liberação Profética', 'Descrição completa do evento aqui.', null, '2012-04-05', '2012-04-08', '50', '5', '2012-03-30', '2012-02-24', '1');
COMMIT;

-- ----------------------------
--  Table structure for `tbInscricoes`
-- ----------------------------
DROP TABLE IF EXISTS `tbInscricoes`;
CREATE TABLE `tbInscricoes` (
  `codInscricao` int(11) NOT NULL AUTO_INCREMENT,
  `codUsuario` int(11) NOT NULL,
  `codEvento` int(11) NOT NULL,
  `icDataCad` date DEFAULT NULL,
  `icFormaPagto` varchar(50) DEFAULT NULL,
  `icTipoInscricao` varchar(50) DEFAULT NULL,
  `icQtde` int(4) DEFAULT NULL,
  `icStatus` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`codInscricao`,`codUsuario`,`codEvento`),
  KEY `fk_tbInscricoes_tbUsuarios` (`codUsuario`),
  KEY `fk_tbInscricoes_tbEventos1` (`codEvento`),
  CONSTRAINT `fk_tbInscricoes_tbEventos1` FOREIGN KEY (`codEvento`) REFERENCES `tbeventos` (`codEvento`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_tbInscricoes_tbUsuarios` FOREIGN KEY (`codUsuario`) REFERENCES `tbusuarios` (`codUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
--  Table structure for `tbPagamentos`
-- ----------------------------
DROP TABLE IF EXISTS `tbPagamentos`;
CREATE TABLE `tbPagamentos` (
  `codPagamento` int(11) NOT NULL AUTO_INCREMENT,
  `codUsuario` int(11) NOT NULL,
  `codInscricao` int(11) NOT NULL,
  `pgForma` varchar(50) DEFAULT NULL,
  `pgDataPag` date DEFAULT NULL,
  `pgValor` double DEFAULT NULL,
  `pgObs` varchar(255) DEFAULT NULL,
  `pgStatus` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`codPagamento`,`codUsuario`),
  KEY `fk_tbPagamentos_tbUsuarios1` (`codUsuario`),
  KEY `fk_tbPagamentos_tbInscricoes1` (`codInscricao`),
  CONSTRAINT `fk_tbPagamentos_tbInscricoes1` FOREIGN KEY (`codInscricao`) REFERENCES `tbinscricoes` (`codInscricao`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_tbPagamentos_tbUsuarios1` FOREIGN KEY (`codUsuario`) REFERENCES `tbusuarios` (`codUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
--  Table structure for `tbUsuarios`
-- ----------------------------
DROP TABLE IF EXISTS `tbUsuarios`;
CREATE TABLE `tbUsuarios` (
  `codUsuario` int(11) NOT NULL AUTO_INCREMENT,
  `usNome` varchar(150) DEFAULT NULL,
  `usCpf` varchar(15) DEFAULT NULL,
  `usEndereco` varchar(255) DEFAULT NULL,
  `usBairro` varchar(100) DEFAULT NULL,
  `usCidade` varchar(100) DEFAULT NULL,
  `usUf` char(2) DEFAULT NULL,
  `usCep` varchar(10) DEFAULT NULL,
  `usTelefone` varchar(13) DEFAULT NULL,
  `usEmail` varchar(150) DEFAULT NULL,
  `usSenha` varchar(200) DEFAULT NULL,
  `usDataCad` date DEFAULT NULL,
  `usAtivo` tinyint(1) DEFAULT NULL,
  `usAdmin` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`codUsuario`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

-- ----------------------------
--  Records of `tbUsuarios`
-- ----------------------------
BEGIN;
INSERT INTO `tbUsuarios` VALUES ('1', 'Eliel de Paula', '123456789', 'Rua sem nome da silva', 'Centro', 'Palmas', 'TO', '77000000', '1234567890', 'elieldepaula@gmail.com', '123', null, null, null), ('2', 'Eliel Ulisses F. de Paula', '91927412153', '303 Norte, Alameda 16, Lote 07.', 'Plano diretor norte', 'Palmas', 'TO', '77001564', '63-8125-2321', 'elieldepaula@gmail.com', '85688aa77f8bfcc77b4e5020213cd2ef', '2012-02-24', '1', '0'), ('3', 'Novo usuario de teste', '91927412153', '303 Norte, Alameda 16, Lote 07.', 'Plano diretor norte', 'Palmas', 'TO', '77001564', '63-8125-2321', 'elieldepaula@gmail.com', 'b558ef5455df62a041ce7a61ca1e50ba', '2012-02-24', '1', '0'), ('4', 'Teste de inscricao 001', '123123123', 'Sem endereÃ§o', 'Centro', 'Cidade', 'GO', '87878787', '123123123', 'elieldepaula@gmail.com', '85688aa77f8bfcc77b4e5020213cd2ef', '2012-02-24', '1', '0');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
